using System;
namespace Week1
{
    internal class Week1Text2
    {
        static void Main(string[] args)
        {
            Console.Write("请输入第一个整数：");
            int n1 = Convert.ToInt32(Console.ReadLine());
            Console.Write("请输入第二个整数：");
            int n2 = Convert.ToInt32(Console.ReadLine());
            int begin = n1 < n2 ? n1 : n2;
            int end = n1 > n2 ? n1 : n2;
            Console.Write("从{0}到{1}之间的素数有：", begin, end);
            int total = 0;
            
            for(int i = begin; i <= end; i++)
            {
                bool flag = true;
                if (i < 2)
                    flag = false;
                else
                {
                    for(int j = 2; j < Convert.ToInt32(i / 2) ; j++)
                    {
                        if (i % j == 0)
                        {
                            flag = false;
                            break;
                        }
                    }
                }
                if (flag)
                {
                    total++;
                    if (total % 10 == 0)
                        Console.Write(i + "\n");
                    else
                        Console.Write(i + " ");
                }
            }
            Console.ReadKey();
        }
    }
}